<?php

namespace Modules\Common\Models;

use Modules\Common\Models\Validation\CategoriesValidation;


class Categories extends BaseModel
{
    protected $connection = 'mysql';
    protected $table = 'categories';
    use CategoriesValidation;

    public function adminUser()
    {
        return $this->belongsTo(AdminUser::class, 'admin_user_id');
    }
    
    
    // 定义分类与电子书的一对多关系
    public function ebook()
    {
        return $this->hasMany(Ebooks::class, 'category_id');
    }

}